package com.fy.search.dto;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.math.BigDecimal;


@Data
@Document(indexName = "commodity", type = "_doc", shards = 0)
public class CommodityDto {

    //商品图片
    private String commodityImg;

    //商品id
    @Id
    private Integer commodityId;

    //商品名称
    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String commodityName;

    //商品价格
    private BigDecimal price;

    //商品销量
    private Integer sales;

    //门店名称
    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String shopName;

    //门店id
    private Integer shopId;
}